﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:conv="clr-namespace:AmazingWPFControls.Converters"
        xmlns:local="clr-namespace:AmazingWPFControls">

    <Style TargetType="{x:Type local:HeaderedControl}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:HeaderedControl}">
                    <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}">
                        <DockPanel>
                            <Border x:Name="PART_Header" DockPanel.Dock="{Binding PositionOfTheHeader,
                                RelativeSource={RelativeSource Mode=TemplatedParent},
                                Converter={conv:HeaderPositionToDockPositionConverter}}" Background="Transparent">
                                <ContentPresenter Content="{TemplateBinding Header}" />
                            </Border>
                            <ContentPresenter Content="{TemplateBinding Content}" />
                        </DockPanel>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>